package br.unifor.cct.mia.runner;

import java.io.File;
import java.io.IOException;

import br.unifor.cct.mia.coevolution.InvalidTypeException;
import br.unifor.cct.mia.dataenhancement.Database;
import br.unifor.cct.mia.dataenhancement.GenotypeConverter;
import br.unifor.cct.mia.dataenhancement.Structure;
import br.unifor.cct.mia.evaluate.Evaluate;
import br.unifor.cct.mia.evaluate.classification.WekaClassification;
import br.unifor.cct.mia.util.LoadFile;

public class ClassificationTest {

	public static String BASE_NAME = "soybean";
	public static String DATASET_STRUCTURE = "./data/"+BASE_NAME+"_estrutura.txt";
	public static String DATASET_DATA = "./data/"+BASE_NAME+"_data.txt";
	
	public static void main(String[] args) throws IOException, InvalidTypeException, InterruptedException {
		
		Structure st = LoadFile.loadStructure(DATASET_STRUCTURE);
    	Database db = LoadFile.loadDatabase(DATASET_DATA);
		System.out.println("Arquivos carregados com sucesso");
		
		GenotypeConverter converter = new GenotypeConverter();
		File f = converter.fullConvert("temp/result"+BASE_NAME+"Test.txt",st,db);
		
		WekaClassification classif = new WekaClassification(Evaluate.J48,null);		
		double fitness = classif.evaluate(f);
		
		System.out.println("Fitness: "+fitness);
	}

}
